package demo.pattern.factory.simple;

import demo.pattern.factory.entity.DeilMouse;
import demo.pattern.factory.entity.HpMouse;
import demo.pattern.factory.entity.Mouse;

/**
 * @ClassName MouseFactory
 * @Description
 * @Author 47980
 * @Date 2020/6/10 20:01
 * @Version V_1.0
 **/
public class MouseFactory {

    public static Mouse createMouse(int type) {
        switch (type) {
            case 0:return new DeilMouse();
            case 1:return new HpMouse();
            default:return new DeilMouse();
        }
    }

    public static void main(String[] args) {
        Mouse mouse = MouseFactory.createMouse(1);
        mouse.sayHi();
    }
}
